package com.xiaofeinode.mapper;

import com.xiaofeinode.pojo.User;
import lombok.Data;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

    @Insert("insert into user(id,username,password) values (null,#{user.username},#{user.password})")
    Integer add(@Param("user") User user);

    @Delete("delete from user where id=#{id}")
    Integer delete(Integer id);

    @Select("select * from user")
    List<User> select();

    @Update("update user set username = #{username},password=#{password} where id=#{id};")
    Integer update(User user);
}
